let vm = new Vue({
    el:'.main-container',  //选中整个main
    data:{
        printInfo:{},//初始化对象     vue建议声明对象同时进行初始化，避免undefinded
        countWigth:0
    },
    methods:{
        selectById:function () {
            axios({
                url:`/guguanjia/manager/work/admin/selectById/${this.printInfo.id}`
            }).then(result=>{
                this.printInfo = result.data.obj;
                let details = this.printInfo.details;
                for (let i = 0; i <details.length; i++) {
                    this.countWigth=details[i].weight+this.countWigth;
                }
                // console.log(this.countWigth)
            }).catch(error=>{
                console.log(error.message)
            })
        },
    },
    created:function () {
        this.printInfo.id = parent.layer.obj;
        this.selectById();
        // this.countWigths();
        // console.log(1111);
        // console.log(this.printInfo.id);
    }
});